import React, { FC, ReactElement } from 'react';
import { usePhoneList } from '../hooks';

import Header from '../components/Header';
import { PhoneList } from '../components/PhoneList';

export const Home: FC = (): ReactElement => {
  //编写一个自定义hooks去完成phoneList的数据请求
  const phoneList = usePhoneList();
  // console.log(phoneList);

  return (
    <div className="container">
      <Header headerTitle="商品列表" iconShow={false} />
      {phoneList && <PhoneList phoneList={phoneList} />}
    </div>
  );
};
